{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "392d700e-9b95-4b4d-8970-e0bea17b4867",
   "metadata": {},
   "source": [
    "Chapter 06\n",
    "# 成员运算符\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "29057c4c-377c-4b37-9aa4-1ef862438798",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义一个列表\n",
    "my_list = [1, 2, 3, 4, 5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ef7bac91-b303-497a-b394-fec6a736c6eb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n",
      "False\n"
     ]
    }
   ],
   "source": [
    "# 判断元素是否在列表中\n",
    "print(3 in my_list)  # True\n",
    "print(6 in my_list)  # False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "bf5d5fc8-9785-4dd8-b8ae-c3964c316a74",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n",
      "True\n"
     ]
    }
   ],
   "source": [
    "# 判断元素是否不在列表中\n",
    "print(3 not in my_list)  # False\n",
    "print(6 not in my_list)  # True"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
